<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	
	</head>
	<body>
		
		<div>
			DOM 中的属性操作
		</div>
		
		<div >
			
			<span  id="first" class="span"> span1</span>
			<span  class="span"> span2</span>
			<span class="span">span3</span>
			
		</div>
		
		<input data-id="333"   value="用户名" name="username" />
		
		<script>
			//设置标签背景颜色 ，style
			var div = document.getElementsByTagName("div")[0];
			
		 //    div.style.backgroundColor = "red"
			// div.style.width = "200px"
			// div.style.height = "200px"
			
			
			// 一次性设置多个样式
			
			div.style.cssText="height:200px;width:200px;background-color:red"
			
			
		

		
		</script>
		
		
	</body>
</html>